package com.xbongbong.pro.statistic.result.pojo;

import com.xbongbong.pro.statistic.enums.SystemCodeEnum;
import com.xbongbong.pro.statistic.enums.ValueTypeEnum;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;

/**
 * 图表统计结果缓存pojo
 * @author zcp
 * @version v1.0
 * @since v1.0
 */
@Getter
@Setter
@ToString
public class ChartResultRedisPojo implements Serializable {
    private static final long serialVersionUID = -9216926806338021709L;
    /**
     * 必传，统计基础参数pojo
     */
    private ChartResultBasePojo chartResultBasePojo;
    /**
     * 非必传，系统指标枚举，自定义pk不传
     * 原因：（1）其他指标内可能调用另外指标的统计（比如求比例时的分子分母）；
     *      （2）相同统计指标可以共用一份缓存，比如首页简报看板的跟进客户、与首页客户模块里面的跟进客户其实是一样的统计方式
     */
    private SystemCodeEnum systemCodeEnum;
    /**
     * 非必传，返回值类型，统计汇总类型
     */
    private ValueTypeEnum valueTypeEnum;
    /**
     * 非必传，后缀，其他关键信息
     */
    private String otherSuffix;

    public ChartResultRedisPojo(ChartResultBasePojo chartResultBasePojo, SystemCodeEnum systemCodeEnum) {
        this.chartResultBasePojo = chartResultBasePojo;
        this.systemCodeEnum = systemCodeEnum;
    }

    public ChartResultRedisPojo(ChartResultBasePojo chartResultBasePojo, String otherSuffix) {
        this.chartResultBasePojo = chartResultBasePojo;
        this.otherSuffix = otherSuffix;
    }

    public ChartResultRedisPojo(ChartResultBasePojo chartResultBasePojo, SystemCodeEnum systemCodeEnum, ValueTypeEnum valueTypeEnum) {
        this.chartResultBasePojo = chartResultBasePojo;
        this.systemCodeEnum = systemCodeEnum;
        this.valueTypeEnum = valueTypeEnum;
    }

    public ChartResultRedisPojo(ChartResultBasePojo chartResultBasePojo, SystemCodeEnum systemCodeEnum, String otherSuffix) {
        this.chartResultBasePojo = chartResultBasePojo;
        this.systemCodeEnum = systemCodeEnum;
        this.otherSuffix = otherSuffix;
    }

    public ChartResultRedisPojo(ChartResultBasePojo chartResultBasePojo, SystemCodeEnum systemCodeEnum, ValueTypeEnum valueTypeEnum, String otherSuffix) {
        this.chartResultBasePojo = chartResultBasePojo;
        this.systemCodeEnum = systemCodeEnum;
        this.valueTypeEnum = valueTypeEnum;
        this.otherSuffix = otherSuffix;
    }
}
